﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;

namespace UserCenter.SqlConcrete
{
   public  class SqlUserInfoRepository
    {     
           private Table<UserInfo> _userInfo;
        

           private DataContext _context = null;

           public DataContext Context
           {
               get { return _context; }
               set { _context = value; }
           }

           public SqlUserInfoRepository(string connectionString)
           {
               Ini(new DataContext(connectionString));

           }
           public SqlUserInfoRepository(DataContext connection)
           {
               Ini(connection);
           }

           private void Ini(DataContext connection)
           {
               _context = connection;               
               _userInfo=_context.GetTable<UserInfo>();
           }

           #region ITagRepository 成员

           public IQueryable<UserInfo> UserInfos
           {
               get { return _userInfo; }
           }

           #endregion
       
    }
}
